﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace InscriberControlClient
{
    /// <summary>
    /// Interaction logic for Window7.xaml
    /// </summary>
    public partial class Window7 : Window
    {
     

        public Window7()
        {
            InitializeComponent();
            Functionality.getAnonsaiParts(listBox1);
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            int location = listBox1.SelectedIndex;
            if (location > 0)
            {
                object rememberMe = listBox1.SelectedItem;
                listBox1.Items.RemoveAt(location);
                listBox1.Items.Insert(location - 1, rememberMe);
                listBox1.SelectedIndex = location - 1;
            }
        }

        private void button3_Click(object sender, RoutedEventArgs e)
        {
            int location = listBox1.SelectedIndex;
            if (location < listBox1.Items.Count - 1)
            {
                object rememberMe = listBox1.SelectedItem;
                listBox1.Items.RemoveAt(location);
                listBox1.Items.Insert(location + 1, rememberMe);
                listBox1.SelectedIndex = location + 1;
            }
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Functionality.AddAnonsaoEtersi(listBox1);
        }
    }
}
